nethackfandomcom-20200214-history
Source:NetHack 3.2.0/config.h
Below is the full text to config.h from the source code of NetHack 3.2.0. To link to a particular line, write [[NetHack 3.2.0/config.h#line123]], for example. Warning! This is the source code from an old release. For the latest release, see Source code 1. /* SCCS Id: @(#)config.h 3.2 96/01/15 */ 2. /* Copyright © Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3. /* NetHack may be freely redistributed. See license for details. */ 4. 5. #ifndef CONFIG_H /* make sure the compiler does not see the typedefs twice */ 6. #define CONFIG_H 7. 8. 9. /* 10. * Section 1: OS selection. 11. * Select the version of the OS you are using. 12. * For "UNIX" select BSD, ULTRIX, SYSV, or HPUX in unixconf.h. 13. * A "VMS" option is not needed since the VMS C-compilers 14. * provide it (no need to change sec#1, vmsconf.h handles it). 15. */ 16. 17. #define UNIX /* delete if no fork(), exec() available */ 18. 19. /* 20. * MS DOS - compilers 21. * 22. * Microsoft C auto-defines MSDOS, 23. * Borland C auto-defines __MSDOS__, 24. * DJGPP auto-defines MSDOS. 25. */ 26. 27. /* #define MSDOS /* use if not defined by compiler or cases below */ 28. 29. #ifdef __MSDOS__ /* for Borland C */ 30. # ifndef MSDOS 31. # define MSDOS 32. # endif 33. #endif 34. 35. #ifdef __TURBOC__ 36. # define __MSC /* increase Borland C compatibility in libraries */ 37. #endif 38. 39. #ifdef MSDOS 40. # undef UNIX 41. #endif 42. 43. /* 44. * Mac Stuff. 45. */ 46. #ifdef applec /* MPW auto-defined symbol */ 47. # define MAC 48. # undef UNIX 49. #endif 50. 51. #ifdef THINK_C /* Think C auto-defined symbol */ 52. # define MAC 53. # define NEED_VARARGS 54. # undef UNIX 55. #endif 56. 57. #ifdef __MWERKS__ /* defined by Metrowerks compiler */ 58. # define MAC 59. # define NEED_VARARGS 60. # define USE_STDARGS 61. # undef UNIX 62. #endif 63. 64. 65. /* 66. * Amiga setup. 67. */ 68. #ifdef AZTEC_C /* Manx auto-defines this */ 69. # ifdef MCH_AMIGA /* Manx auto-defines this for AMIGA */ 70. # ifndef AMIGA 71. #define AMIGA /* define for Commodore-Amiga */ 72. # endif /* (SAS/C auto-defines AMIGA) */ 73. #define AZTEC_50 /* define for version 5.0 of manx */ 74. # endif 75. #endif 76. #ifdef __SASC_60 77. # define NEARDATA __near /* put some data close */ 78. #else 79. # ifdef _DCC 80. # define NEARDATA __near /* put some data close */ 81. # else 82. # define NEARDATA 83. # endif 84. #endif 85. #ifdef AMIGA 86. # define NEED_VARARGS 87. # undef UNIX 88. # define DLB 89. # define HACKDIR "NetHack:" 90. # define NO_MACRO_CPATH 91. #endif 92. 93. /* 94. * Atari auto-detection 95. */ 96. 97. #ifdef atarist 98. # undef UNIX 99. # define TOS 100. #else 101. # ifdef __MINT__ 102. # undef UNIX 103. # define TOS 104. # endif 105. #endif 106. 107. /* 108. * Windows NT Autodetection 109. */ 110. 111. #ifdef WIN32 112. # undef UNIX 113. # undef MSDOS 114. #endif 115. 116. /* 117. * and other systems... 118. */ 119. 120. /* #define OS2 /* define for OS/2 */ 121. 122. /* #define TOS /* define for Atari ST/TT */ 123. 124. /* #define STUPID /* avoid some complicated expressions if 125. your C compiler chokes on them */ 126. /* #define TERMINFO /* uses terminfo rather than termcap */ 127. /* should be defined for HPUX and most, but not all, 128. SYSV */ 129. /* in particular, it should NOT be defined for the 130. * UNIXPC unless you remove the use of the shared 131. * library in the makefile */ 132. /* #define MINIMAL_TERM /* if a terminal handles highlighting or tabs poorly, 133. try this define, used in pager.c and termcap.c */ 134. /* #define ULTRIX_CC20 /* define only if using cc v2.0 on a DECstation */ 135. /* #define ULTRIX_PROTO /* define for Ultrix 4.0 (or higher) on a DECstation; 136. * if you get compiler errors, don't define this. */ 137. /* Hint: if you're not developing code, don't define 138. ULTRIX_PROTO. */ 139. 140. #ifdef VMS /* really old compilers need special handling, detected here */ 141. # undef UNIX 142. # ifdef __DECC 143. # ifndef __DECC_VER /* buggy early versions want widened prototypes */ 144. # define NOTSTDC /* except when typedefs are involved */ 145. # define USE_VARARGS 146. # else 147. # define NHSTDC 148. # define USE_STDARG 149. # define POSIX_TYPES 150. # define _DECC_V4_SOURCE /* avoid some incompatible V5.x changes */ 151. # endif 152. # undef __HIDE_FORBIDDEN_NAMES /* need non-ANSI library support functions */ 153. # else 154. # ifdef VAXC /* must use CC/DEFINE=ANCIENT_VAXC for vaxc v2.2 or older */ 155. # ifdef ANCIENT_VAXC /* vaxc v2.2 and earlier of warnings to come */ 156. # define KR1ED /* simulate defined() */ 157. # define USE_VARARGS 158. # else /* vaxc v2.3,2.4,or 3.x, or decc in vaxc mode */ 159. # if defined(USE_PROTOTYPES) /* this breaks 2.2 (*forces* use of ANCIENT)*/ 160. # define __STDC__ 0 /* vaxc is not yet ANSI compliant, but close enough */ 161. # define signed /* well, almost close enough */ 162. #include 163. # define UNWIDENED_PROTOTYPES 164. # endif 165. # define USE_STDARG 166. # endif 167. # endif /*VAXC*/ 168. # endif /*__DECC*/ 169. # ifdef VERYOLD_VMS /* v4.5 or earlier; no longer available for testing */ 170. # define USE_OLDARGS /* is there, vprintf & vsprintf aren't */ 171. # ifdef USE_VARARGS 172. # undef USE_VARARGS 173. # endif 174. # ifdef USE_STDARG 175. # undef USE_STDARG 176. # endif 177. # endif 178. #endif /*VMS*/ 179. 180. #ifdef vax 181. /* just in case someone thinks a DECstation is a vax. It's not, it's a mips */ 182. # ifdef ULTRIX_PROTO 183. # undef ULTRIX_PROTO 184. # endif 185. # ifdef ULTRIX_CC20 186. # undef ULTRIX_CC20 187. # endif 188. #endif 189. 190. #ifdef KR1ED /* For compilers which cannot handle defined() */ 191. #define defined(x) (-x-1 != -1) 192. /* Because: 193. * #define FOO => FOO={} => defined( ) => (-1 != - - 1) => 1 194. * #define FOO 1 or on command-line -DFOO 195. * => defined(1) => (-1 != - 1 - 1) => 1 196. * if FOO isn't defined, FOO=0. But some compilers default to 0 instead of 1 197. * for -DFOO, oh well. 198. * => defined(0) => (-1 != - 0 - 1) => 0 199. * 200. * But: 201. * defined("") => (-1 != - "" - 1) 202. * is an unavoidable catastrophe. 203. */ 204. #endif 205. 206. /* Windowing systems... 207. * Define all of those you want supported in your binary. 208. * Some combinations make no sense. See the installation document. 209. */ 210. #define TTY_GRAPHICS /* good old tty based graphics */ 211. /* #define X11_GRAPHICS /* X11 interface */ 212. 213. /* 214. * Define the default window system. This should be one that is compiled 215. * into your system (see defines above). Known window systems are: 216. * 217. * tty, X11, mac, amii, win32 218. */ 219. 220. /* MAC also means MAC windows */ 221. #ifdef MAC 222. # ifndef AUX 223. # define DEFAULT_WINDOW_SYS "mac" 224. # endif 225. #endif 226. 227. /* Amiga supports AMII_GRAPHICS and/or TTY_GRAPHICS */ 228. #ifdef AMIGA 229. # define AMII_GRAPHICS /* (optional) */ 230. # define DEFAULT_WINDOW_SYS "amii" /* "amii", "amitile" or "tty" */ 231. #endif 232. 233. /* Windows NT supports TTY_GRAPHICS */ 234. #ifdef WIN32 235. # define DEFAULT_WINDOW_SYS "tty" 236. #endif 237. 238. #ifndef DEFAULT_WINDOW_SYS 239. # define DEFAULT_WINDOW_SYS "tty" 240. #endif 241. 242. #ifdef X11_GRAPHICS 243. /* 244. * There are two ways that X11 tiles may be defined. (1) using a custom 245. * format loaded by NetHack code, or (2) using the XPM format loaded by 246. * the free XPM library. The second option allows you to then use other 247. * programs to generate tiles files. For example, the PBMPlus tools 248. * would allow: 249. * xpmtoppm x11tiles_big.xpm 250. */ 251. /* # define USE_XPM /* Disable if you do not have the XPM library */ 252. # ifdef USE_XPM 253. # define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.xpm) */ 254. # endif 255. #endif 256. 257. /* 258. * Section 2: Some global parameters and filenames. 259. * Commenting out WIZARD, LOGFILE, or NEWS removes that feature 260. * from the game; otherwise set the appropriate wizard name. 261. * LOGFILE and NEWS refer to files in the playground. 262. */ 263. 264. #ifndef WIZARD /* allow for compile-time or Makefile changes */ 265. # ifndef KR1ED 266. # define WIZARD "wizard" /* the person allowed to use the -D option */ 267. # else 268. # define WIZARD 269. # define WIZARD_NAME "wizard" 270. # endif 271. #endif 272. 273. #define LOGFILE "logfile" /* larger file for debugging purposes */ 274. #define NEWS "news" /* the file containing the latest hack news */ 275. 276. /* 277. * If COMPRESS is defined, it should contain the full path name of your 278. * 'compress' program. Defining INTERNAL_COMP causes NetHack to do 279. * simpler byte-stream compression internally. Both COMPRESS and 280. * INTERNAL_COMP create smaller bones/level/save files, but require 281. * additional code and time. Currently, only UNIX fully implements 282. * COMPRESS; other ports should be able to uncompress save files a 283. * la unixmain.c if so inclined. 284. * If you define COMPRESS, you must also define COMPRESS_EXTENSION 285. * as the extension your compressor appends to filenames after 286. * compression. 287. */ 288. 289. #ifdef UNIX 290. /* path and file name extension for compression program */ 291. # define COMPRESS "/usr/ucb/compress" /* Lempel-Ziv compression */ 292. # define COMPRESS_EXTENSION ".Z" /* compress's extension */ 293. 294. /* An example of one alternative you might want to use: */ 295. /* # define COMPRESS "/usr/local/bin/gzip" /* FSF gzip compression */ 296. /* # define COMPRESS_EXTENSION ".gz" /* normal gzip extension */ 297. #endif 298. #ifndef COMPRESS 299. # define INTERNAL_COMP /* control use of NetHack's compression routines */ 300. #endif 301. 302. /* 303. * Data librarian. Defining DLB places most of the support files into 304. * a tar-like file, thus making a neater installation. See *conf.h 305. * for detailed configuration. 306. */ 307. /* #define DLB /* not supported on all platforms */ 308. 309. /* 310. * Defining INSURANCE slows down level changes, but allows games that 311. * died due to program or system crashes to be resumed from the point 312. * of the last level change, after running a utility program. 313. */ 314. #define INSURANCE /* allow crashed game recovery */ 315. 316. #ifndef MAC 317. # define CHDIR /* delete if no chdir() available */ 318. #endif 319. 320. #ifdef CHDIR 321. /* 322. * If you define HACKDIR, then this will be the default playground; 323. * otherwise it will be the current directory. 324. */ 325. # ifndef HACKDIR 326. # define HACKDIR "/usr/games/lib/nethackdir" /* nethack directory */ 327. # endif 328. 329. /* 330. * Some system administrators are stupid enough to make Hack suid root 331. * or suid daemon, where daemon has other powers besides that of reading or 332. * writing Hack files. In such cases one should be careful with chdir's 333. * since the user might create files in a directory of his choice. 334. * Of course SECURE is meaningful only if HACKDIR is defined. 335. */ 336. /* #define SECURE /* do setuid(getuid()) after chdir() */ 337. 338. /* 339. * If it is desirable to limit the number of people that can play Hack 340. * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS. 341. * #define MAX_NR_OF_PLAYERS 6 342. */ 343. #endif /* CHDIR */ 344. 345. 346. 347. /* 348. * Section 3: Definitions that may vary with system type. 349. * For example, both schar and uchar should be short ints on 350. * the AT&T 3B2/3B5/etc. family. 351. */ 352. 353. /* 354. * Uncomment the following line if your compiler doesn't understand the 355. * 'void' type (and thus would give all sorts of compile errors without 356. * this definition). 357. */ 358. /* #define NOVOID /* define if no "void" data type. */ 359. 360. /* 361. * Uncomment the following line if your compiler falsely claims to be 362. * a standard C compiler (i.e., defines __STDC__ without cause). 363. * Examples are Apollo's cc (in some versions) and possibly SCO UNIX's rcc. 364. */ 365. /* #define NOTSTDC /* define for lying compilers */ 366. 367. #include "tradstdc.h" 368. 369. /* 370. * type schar: small signed integers (8 bits suffice) (eg. TOS) 371. * 372. * typedef char schar; 373. * 374. * will do when you have signed characters; otherwise use 375. * 376. * typedef short int schar; 377. */ 378. #ifdef AZTEC 379. # define schar char 380. #else 381. typedef signed char schar; 382. #endif 383. 384. /* 385. * type uchar: small unsigned integers (8 bits suffice - but 7 bits do not) 386. * 387. * typedef unsigned char uchar; 388. * 389. * will be satisfactory if you have an "unsigned char" type; 390. * otherwise use 391. * 392. * typedef unsigned short int uchar; 393. */ 394. #ifndef _AIX32 /* identical typedef in system file causes trouble */ 395. typedef unsigned char uchar; 396. #endif 397. 398. /* 399. * Various structures have the option of using bitfields to save space. 400. * If your C compiler handles bitfields well (e.g., it can initialize structs 401. * containing bitfields), you can define BITFIELDS. Otherwise, the game will 402. * allocate a separate character for each bitfield. (The bitfields used never 403. * have more than 7 bits, and most are only 1 bit.) 404. */ 405. #define BITFIELDS /* Good bitfield handling */ 406. 407. /* #define STRNCMPI /* compiler/library has the strncmpi function */ 408. 409. /* 410. * There are various choices for the NetHack vision system. There is a 411. * choice of two algorithms with the same behavior. Defining VISION_TABLES 412. * creates huge (60K) tables at compile time, drastically increasing data 413. * size, but runs slightly faster than the alternate algorithm. (MSDOS in 414. * particular cannot tolerate the increase in data size; other systems can 415. * flip a coin weighted to local conditions.) 416. * 417. * If VISION_TABLES is not defined, things will be faster if you can use 418. * MACRO_CPATH. Some cpps, however, cannot deal with the size of the 419. * functions that have been macroized. 420. */ 421. 422. /*#define VISION_TABLES /* use vision tables generated at compile time */ 423. #ifndef VISION_TABLES 424. # ifndef NO_MACRO_CPATH 425. # define MACRO_CPATH /* use clear_path macros instead of functions */ 426. # endif 427. #endif 428. 429. 430. 431. /* 432. * Section 4: THE FUN STUFF!!! 433. * 434. * Conditional compilation of special options are controlled here. 435. * If you define the following flags, you will add not only to the 436. * complexity of the game but also to the size of the load module. 437. */ 438. 439. /* dungeon features */ 440. #define WEAPON_SKILLS /* Weapon skills - Stephen White */ 441. #define SINKS /* Kitchen sinks - Janet Walz */ 442. /* dungeon levels */ 443. #define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */ 444. #define REINCARNATION /* Special Rogue-like levels */ 445. /* monsters & objects */ 446. #define KOPS /* Keystone Kops by Scott R. Turner */ 447. #define SEDUCE /* Succubi/incubi seduction, by KAA, suggested by IM */ 448. #define TOURIST /* Tourist players with cameras and Hawaiian shirts */ 449. /* difficulty */ 450. #define ELBERETH /* Engraving the E-word repels monsters */ 451. /* I/O */ 452. #define REDO /* support for redoing last command - DGK */ 453. #if !defined(MAC) 454. # define CLIPPING /* allow smaller screens -- ERS */ 455. #endif 456. 457. #ifdef REDO 458. # define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */ 459. #endif 460. 461. #define EXP_ON_BOTL /* Show experience on bottom line */ 462. /* #define SCORE_ON_BOTL /* added by Gary Erickson (erickson@ucivax) */ 463. 464. #include "global.h" /* Define everything else according to choices above */ 465. 466. #endif /* CONFIG_H */ config.h